//package com.punch.course.controller;
//
//import cn.hutool.core.collection.CollUtil;
//import com.punch.common.dto.course.CourseAuditDTO;
//import com.punch.common.dto.course.CourseDTO;
//import com.punch.common.dto.course.CourseTeachingDTO;
//import com.punch.common.model.Result;
//import com.punch.common.page.PageInfo;
//import com.punch.common.vo.course.*;
//import com.punch.common.vo.course.report.CourseReportVO;
//import com.punch.common.vo.course.report.OrganReportVO;
//import com.punch.common.vo.user.user.SimpleSchoolVO;
//import com.punch.course.exception.CourseExceptionEnum;
//import com.punch.course.query.CourseQueryInfo;
//import com.punch.course.service.CourseService;
//import com.punch.course.service.CourseTeachingService;
//import com.punch.course.service.StudentCourseScheduleService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import javax.validation.Valid;
//import java.util.List;
//
//
///**
// * 课程管理
// *
// * @author xiaol
// * @version 1.0.0
// * @since 2020/7/14 10:51
// */
//@RestController
//@Api(value = "CourseController", tags = "课程管理Controller")
//@Deprecated
//public class CourseController {
//
//    @Resource
//    private CourseService courseService;
//
//    @Resource
//    private CourseTeachingService courseTeachingService;
//
//    @Resource
//    private StudentCourseScheduleService studentCourseScheduleService;
//
////    /**
////     * 条件分页查询课程列表
////     *
////     * @return IPage<CoursePageVO>
////     * @author xiaol
////     * @since 2020/7/14 10:51
////     */
////    @GetMapping(value = "/courses", produces = "application/json; charset=utf-8")
////    @ApiOperation(value = "条件查询课程列表", notes = "条件查询课程列表", produces = "application/json")
////    public Result<PageInfo<CoursePageVO>> listCourse(@ModelAttribute CourseQueryInfo queryInfo) {
////        return Result.succeed(courseService.listCourse(queryInfo));
////    }
//
//    /**
//     * 条件分页查询课程库
//     *
//     * @return IPage<CoursePageVO>
//     * @author xiaol
//     * @since 2020/7/14 10:51
//     */
//    @GetMapping(value = "/courses/library", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "条件分页查询课程库", notes = "条件分页查询课程库", produces = "application/json")
//    public Result<PageInfo<CoursePageVO>> listCourseLibrary(@ModelAttribute CourseQueryInfo queryInfo) {
//        return Result.succeed(courseService.listCourseLibrary(queryInfo));
//    }
//
//    /**
//     * 查询课程详情
//     *
//     * @param courseId 课程id
//     * @return CourseForm
//     * @author xiaol
//     * @since 2020/7/14 10:51
//     */
//    @GetMapping(value = "/course/{courseId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "查询课程列表详情", notes = "查询课程列表详情", produces = "application/json")
//    public Result<CourseVO> getCourseById(@PathVariable Long courseId) {
//        return Result.succeed(courseService.getCourseById(courseId));
//    }
//
//
//    /**
//     * 保存课程信息
//     *
//     * @param courseDTO 课程信息表单
//     * @return courseId
//     * @author xiaol
//     * @since 2020/7/21
//     */
//
//    @PostMapping(value = "/course", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "保存课程信息", notes = "保存课程信息", produces = "application/json")
//    public Result saveCourse(@Valid @RequestBody CourseDTO courseDTO) {
//        Long courseId = courseService.saveCourse(courseDTO);
//        return Result.succeed(courseId, CourseExceptionEnum.COURSE_SAVE_SUCCESS.getMsg());
//    }
//
//    /**
//     * 编辑课程信息
//     *
//     * @param courseDTO 课程信息表单
//     * @return courseId
//     * @author xiaol
//     * @since 2020/7/21
//     */
//
//    @PutMapping(value = "/course", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "编辑课程信息", notes = "编辑课程信息", produces = "application/json")
//    public Result updateCourse(@Valid @RequestBody CourseDTO courseDTO) {
//        Long courseId = courseService.updateCourse(courseDTO);
//        return Result.succeed(courseId, CourseExceptionEnum.COURSE_EDIT_SUCCESS.getMsg());
//    }
//
//    /**
//     * 删除课程信息
//     *
//     * @param courseId 课程id
//     * @return courseId
//     * @author xiaol
//     * @since 2020/6/4 14:38
//     */
//    @DeleteMapping(value = "/course/{courseId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "删除课程信息", notes = "删除课程信息", produces = "application/json")
//    public Result<String> deleteCourseById(@PathVariable Long courseId) {
//        try {
//            courseService.deleteCourseById(courseId);
//        } catch (Exception e) {
//            return Result.failed(CourseExceptionEnum.COURSE_DEL_FAIL.getMsg());
//        }
//
//        return Result.succeed(CourseExceptionEnum.COURSE_DEL_SUCCESS.getMsg());
//    }
//
//
//    /**
//     * 课程下拉列表--只找课程库里面的课程
//     *
//     * @return List<SimpleCourseVO>
//     * @author xiaol
//     * @since 2020/7/23
//     */
//    @GetMapping(value = "/courses/simple", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "课程下拉列表--只找课程库里面的课程", notes = "课程下拉列表--只找课程库里面的课程", produces = "application/json")
//    public Result<List<SimpleCourseVO>> listCourseSelect(@RequestParam(name = "courseName", required = false) String courseName,
//                                                         @RequestParam(name = "classId", required = false) Long classId) {
//        return Result.succeed(courseService.listCourseSelect(courseName, classId));
//    }
//
//    /**
//     * 课程启用/停用
//     */
//    @PutMapping("/course/enable/{courseId}")
//    @ApiOperation(value = "课程启用/停用")
//    public Result enableCourse(@PathVariable Long courseId) {
//        courseService.enableCourse(courseId);
//        return Result.succeed("修改成功");
//    }
//
//    /**
//     * 课程审核
//     *
//     * @param courseAuditDTO 课程信息
//     * @return courseId
//     * @author xiaol
//     * @since 2020/7/21
//     */
//    @PutMapping(value = "/course/audit", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "课程审核", notes = "课程审核", produces = "application/json")
//    public Result auditCourse(@RequestBody CourseAuditDTO courseAuditDTO) {
//        courseService.auditCourse(courseAuditDTO);
//        return Result.succeed(CourseExceptionEnum.COURSE_EDIT_SUCCESS.getMsg());
//    }
//
//
//    /**
//     * 保存授课申请
//     *
//     * @param courseTeachingDTO 授课申请
//     * @return id
//     */
//    @PostMapping(value = "/course/teaching", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "保存授课申请", notes = "保存授课申请", produces = "application/json")
//    public Result saveCourseTeaching(@RequestBody CourseTeachingDTO courseTeachingDTO) {
//        return Result.succeed(courseTeachingService.saveCourseTeaching(courseTeachingDTO));
//    }
//
//    /**
//     * 取消授课申请
//     *
//     * @param teachingId 授课申请Id
//     * @return id
//     */
//    @DeleteMapping(value = "/course/{courseId}/teaching/{teachingId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "取消授课申请", notes = "取消授课申请", produces = "application/json")
//    public Result deleteCourseTeaching(@PathVariable Long courseId, @PathVariable Long teachingId) {
//        courseTeachingService.deleteCourseTeaching(courseId, teachingId);
//        return Result.succeed("");
//    }
//
//
//    /**
//     * 申请授课列表
//     *
//     * @param courseId 课程id
//     * @return list
//     */
//    @GetMapping(value = "/course/{courseId}/teaching", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "申请授课列表", notes = "申请授课列表", produces = "application/json")
//    public Result listCourseTeaching(@PathVariable Long courseId) {
//        return Result.succeed(courseTeachingService.listCourseTeaching(courseId));
//    }
//
//    /**
//     * 学校同意授课--加入到课程库
//     *
//     * @param courseId 课程id
//     */
//    @PutMapping(value = "/course/{courseId}/teaching", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "学校同意授课--加入到课程库", notes = "学校同意授课--加入到课程库", produces = "application/json")
//    public Result agreeCourseTeaching(@PathVariable Long courseId) {
//        courseTeachingService.agreeCourseTeaching(courseId);
//        return Result.succeed("");
//    }
//
//    /**
//     * 学校同意授课--加入到课程库(批量)
//     *
//     * @param courseIds 课程id集合
//     */
//    @PostMapping(value = "/course/batch/teaching", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "学校同意授课--加入到课程库(批量)", notes = "学校同意授课--加入到课程库(批量)", produces = "application/json")
//    public Result agreeCourseBatchTeaching(@RequestBody List<Long> courseIds) {
//        if (CollUtil.isNotEmpty(courseIds)) {
//            for (Long courseId : courseIds) {
//                courseTeachingService.agreeCourseTeaching(courseId);
//            }
//        }
//        return Result.succeed("操作成功");
//    }
//
//    /**
//     * 学校移除课程库id
//     *
//     * @param libraryId 课程库id
//     */
//    @DeleteMapping(value = "/course/library/{libraryId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "学校移除课程库id", notes = "学校移除课程库id", produces = "application/json")
//    public Result removeCourseLibrary(@PathVariable Long libraryId) {
//        courseTeachingService.removeCourseLibrary(libraryId);
//        return Result.succeed("");
//    }
//
//    /**
//     * 课程类型统计
//     *
//     * @return list
//     */
//    @GetMapping(value = "/course/report", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "课程类型统计", notes = "课程类型统计", produces = "application/json")
//    public Result courseReport() {
//        return Result.succeed(courseService.courseReport());
//    }
//
//    /**
//     * 根据课程类型名称获取学校开课详情列表
//     *
//     * @param categoryName 课程分类名称
//     * @return list
//     */
//    @GetMapping(value = "/courses/{categoryName}/detail/report", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "根据课程类型名称获取学校开课详情列表", notes = "根据课程类型名称获取学校开课详情列表", produces = "application/json")
//    public Result coursesDetailReport(@PathVariable String categoryName) {
//        return Result.succeed(courseService.coursesDetailReport(categoryName));
//    }
//
//    /**
//     * 获取课程审核失败原因
//     *
//     * @param courseId 课程id
//     * @return string
//     */
//    @GetMapping("/course/{courseId}/audit-message")
//    @ApiOperation(value = "获取课程审核失败原因", response = SimpleSchoolVO.class)
//    public Result getCourseAuditMessage(@PathVariable Long courseId) {
//        return Result.succeed(courseService.getCourseAuditMessage(courseId), "");
//    }
//
//    /**
//     * 课程课节列表
//     *
//     * @param courseId 课程id
//     * @return list
//     */
//    @GetMapping(value = "/course/{courseId}/lessons", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "课程课节列表", notes = "课程课节列表", produces = "application/json")
//    public Result<List<CourseContentVO>> listCourseLessons(@PathVariable Long courseId) {
//        return Result.succeed(courseService.listCourseLessons(courseId));
//    }
//
//    /**
//     * 根据学校id查询对应的入驻机构数量
//     *
//     * @param schoolId 学校id
//     * @return Integer
//     */
//    @GetMapping(value = "/organ/count/{schoolId}", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "根据学校id查询对应的入驻机构数量")
//    public List<OrganReportVO> getOrganCount(@PathVariable Long schoolId) {
//        return courseService.getOrganCount(schoolId);
//    }
//
//    /**
//     * 根据创建人id（学校id）查询对应的开课数量
//     *
//     * @param createId 创建人id
//     * @return Integer
//     */
//    @GetMapping("/course/count/{createId}")
//    @ApiOperation(value = "根据创建人id（学校id）查询对应的开课数量")
//    public List<CourseReportVO> getCourseCount(@PathVariable Long createId) {
//        return courseService.getCourseCount(createId);
//    }
//
//    /**
//     * 学生上课课程列表
//     *
//     * @param studentId 学生id
//     * @return StuCourseVO
//     */
//    @GetMapping("/course/student/{studentId}")
//    @ApiOperation(value = "学生上课课程列表")
//    public Result<StuCourseVO> listStuCourse(@PathVariable Long studentId) {
//        return Result.succeed(studentCourseScheduleService.listStuCourse(studentId));
//    }
//}
